package com.atguigu.gmall.controller;



import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.client.OrderFeifnClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;

/**
 * ClassName: OrderController
 * Package: com.atguigu.gmall.controller
 * Description:
 *
 * @Author 刘轩
 * @Create 2023-09-02 9:41
 * @Version 1.0
 */

@Controller
public class OrderController {

 @Autowired
 private OrderFeifnClient orderFeifnClient;

 /**
  * 订单确认页面渲染
  * @param model
  * @return
  */
 @GetMapping("trade.html")
 public String trade(Model model){
  Result<Map> result = orderFeifnClient.authTrade();
  model.addAllAttributes(result.getData());

  // 结算页面
  return "order/trade";
 }

 @GetMapping("myOrder.html")
 public String myOrder(){
  //  返回我的订单页面
  return "order/myOrder";
 }
}